<!-- 会员八字表表单弹窗 -->
<form id="birth-form" lay-filter="birth-form" class="layui-form model-form" style="overflow:auto; height:500px;width:90%;">
    <input name="id" type="hidden"/>
    				    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input name="name" placeholder="请输入姓名" type="text" class="layui-input" maxlength="20"  id="name"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">出生日期</label>
        <div class="layui-input-block">
            <input name="birthday" placeholder="请输入出生日期" type="text" class="layui-input" maxlength="20"  id="birthday"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">国籍</label>
        <div class="layui-input-block">
            <input name="birthCountry" placeholder="请输入国籍" type="text" class="layui-input" maxlength="20"  id="birthCountry"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">省份</label>
        <div class="layui-input-block">
            <input name="birthProvince" placeholder="请输入省份" type="text" class="layui-input" maxlength="20"  id="birthProvince"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">城市</label>
        <div class="layui-input-block">
            <input name="birthCity" placeholder="请输入城市" type="text" class="layui-input" maxlength="20"  id="birthCity"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">县</label>
        <div class="layui-input-block">
            <input name="birthXian" placeholder="请输入县" type="text" class="layui-input" maxlength="20"  id="birthXian"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">标签-如与会员的关系</label>
        <div class="layui-input-block">
            <input name="tag" placeholder="请输入标签-如与会员的关系" type="text" class="layui-input" maxlength="20"  id="tag"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">会员ID</label>
        <div class="layui-input-block">
            <input name="memberId" placeholder="请输入会员ID" type="text" class="layui-input" maxlength="20"  id="memberId"
                   lay-verify="required" required/>
        </div>
    </div>
 		    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-block">
            <input name="createDate" placeholder="请输入创建时间" type="text" class="layui-input" maxlength="20"  id="createDate"
                   lay-verify="required" required/>
        </div>
    </div>
     <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <button class="layui-btn" lay-filter="user-form-submit" lay-submit>保存</button>
    </div>
</form>

<script>
    layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var form = layui.form;
        var formSelects = layui.formSelects;
 
        var birth = admin.getTempData('t_birth');
           if (birth.method=="update"){
        	form.val('birth-form', birth);
            form.render();
        }
        // 表单提交事件
        form.on('submit(user-form-submit)', function (data) {
             layer.load(2);
            
            admin.req('member/birth/'+birth.method, JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, "post");  
            return false;
        });
    });
</script>
